package com.feedback.c;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.Log;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.json.JSONObject;

public class c
{
  static final String a = "Util";
  private static final int b = 30000;

  public static String a()
  {
    String str = String.valueOf(System.currentTimeMillis());
    return "RP" + str + String.valueOf((int)(1000.0D + 9000.0D * Math.random()));
  }

  public static String a(String paramString1, String paramString2, String paramString3)
  {
    String str = String.valueOf(System.currentTimeMillis());
    return paramString1 + "[" + paramString2 + "_" + paramString3 + "]" + str + String.valueOf((int)(1000.0D + 9000.0D * Math.random()));
  }

  public static String a(String paramString1, String paramString2, JSONObject paramJSONObject)
  {
    return b(paramString1, paramString2, paramJSONObject);
  }

  public static String a(Date paramDate, Context paramContext)
  {
    SimpleDateFormat localSimpleDateFormat;
    String str;
    if (paramDate == null)
    {
      str = "";
      return str;
    }
    Locale localLocale = paramContext.getResources().getConfiguration().locale;
    if (Locale.CHINA.equals(localLocale))
      localSimpleDateFormat = new SimpleDateFormat("M月d日", localLocale);
    while (true)
    {
      while (true)
        str = localSimpleDateFormat.format(paramDate);
      localSimpleDateFormat = new SimpleDateFormat("dd MMMM", localLocale);
    }
  }

  public static boolean a(String paramString)
  {
    int i;
    if ((paramString != null) && (paramString.trim().length() != 0))
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static boolean a(String paramString1, String paramString2)
  {
    int i;
    Log.i("Util", "[reply_id_of_b]" + paramString2);
    if ((paramString1 == null) || (paramString2 == null))
    {
      i = 0;
      return i;
    }
    try
    {
      while (true)
      {
        double d1 = Double.parseDouble(paramString1.substring(2));
        double d2 = Double.parseDouble(paramString2.substring(2));
        if (d1 < d2)
          break;
        i = 1;
      }
      i = 0;
    }
    catch (Exception localException)
    {
      Log.w("Util", "reply id invalid.LocalMaxReplyId:" + paramString1 + "reply_id_of_b:" + paramString2);
      i = 1;
    }
  }

  public static String b(String paramString)
  {
    return b(paramString, null, null);
  }

  // ERROR //
  private static String b(String paramString1, String paramString2, JSONObject paramJSONObject)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnull +186 -> 187
    //   4: new 151	java/util/ArrayList
    //   7: dup
    //   8: iconst_1
    //   9: invokespecial 154	java/util/ArrayList:<init>	(I)V
    //   12: astore_3
    //   13: aload_3
    //   14: new 156	org/apache/http/message/BasicNameValuePair
    //   17: dup
    //   18: aload_1
    //   19: aload_2
    //   20: invokevirtual 159	org/json/JSONObject:toString	()Ljava/lang/String;
    //   23: invokespecial 162	org/apache/http/message/BasicNameValuePair:<init>	(Ljava/lang/String;Ljava/lang/String;)V
    //   26: invokeinterface 167 2 0
    //   31: pop
    //   32: new 169	org/apache/http/client/entity/UrlEncodedFormEntity
    //   35: dup
    //   36: aload_3
    //   37: ldc 171
    //   39: invokespecial 174	org/apache/http/client/entity/UrlEncodedFormEntity:<init>	(Ljava/util/List;Ljava/lang/String;)V
    //   42: astore 5
    //   44: new 176	org/apache/http/client/methods/HttpPost
    //   47: dup
    //   48: aload_0
    //   49: invokespecial 177	org/apache/http/client/methods/HttpPost:<init>	(Ljava/lang/String;)V
    //   52: astore 6
    //   54: aload 6
    //   56: aload 5
    //   58: invokeinterface 183 1 0
    //   63: invokeinterface 189 2 0
    //   68: aload 6
    //   70: checkcast 176	org/apache/http/client/methods/HttpPost
    //   73: aload 5
    //   75: invokevirtual 193	org/apache/http/client/methods/HttpPost:setEntity	(Lorg/apache/http/HttpEntity;)V
    //   78: aload 6
    //   80: astore 7
    //   82: new 195	org/apache/http/impl/client/DefaultHttpClient
    //   85: dup
    //   86: invokespecial 196	org/apache/http/impl/client/DefaultHttpClient:<init>	()V
    //   89: astore 8
    //   91: aload 8
    //   93: invokeinterface 202 1 0
    //   98: astore 9
    //   100: aload 9
    //   102: sipush 30000
    //   105: invokestatic 208	org/apache/http/params/HttpConnectionParams:setConnectionTimeout	(Lorg/apache/http/params/HttpParams;I)V
    //   108: aload 9
    //   110: sipush 30000
    //   113: invokestatic 211	org/apache/http/params/HttpConnectionParams:setSoTimeout	(Lorg/apache/http/params/HttpParams;I)V
    //   116: aload 9
    //   118: ldc2_w 212
    //   121: invokestatic 219	org/apache/http/conn/params/ConnManagerParams:setTimeout	(Lorg/apache/http/params/HttpParams;J)V
    //   124: aload 8
    //   126: aload 7
    //   128: checkcast 221	org/apache/http/client/methods/HttpUriRequest
    //   131: invokeinterface 225 2 0
    //   136: astore 12
    //   138: aload 12
    //   140: invokeinterface 231 1 0
    //   145: invokeinterface 236 1 0
    //   150: sipush 200
    //   153: if_icmpne +54 -> 207
    //   156: aload 12
    //   158: invokeinterface 240 1 0
    //   163: invokestatic 245	org/apache/http/util/EntityUtils:toString	(Lorg/apache/http/HttpEntity;)Ljava/lang/String;
    //   166: astore 13
    //   168: aload 13
    //   170: astore 11
    //   172: aload 11
    //   174: areturn
    //   175: astore 14
    //   177: new 247	java/lang/AssertionError
    //   180: dup
    //   181: aload 14
    //   183: invokespecial 250	java/lang/AssertionError:<init>	(Ljava/lang/Object;)V
    //   186: athrow
    //   187: new 252	org/apache/http/client/methods/HttpGet
    //   190: dup
    //   191: aload_0
    //   192: invokespecial 253	org/apache/http/client/methods/HttpGet:<init>	(Ljava/lang/String;)V
    //   195: astore 7
    //   197: goto -115 -> 82
    //   200: astore 10
    //   202: aload 10
    //   204: invokevirtual 256	java/lang/Exception:printStackTrace	()V
    //   207: aconst_null
    //   208: astore 11
    //   210: goto -38 -> 172
    //
    // Exception table:
    //   from	to	target	type
    //   32	44	175	java/io/UnsupportedEncodingException
    //   124	168	200	java/lang/Exception
  }

  public static String b(Date paramDate, Context paramContext)
  {
    String str;
    if (paramDate == null)
      str = "";
    while (true)
    {
      return str;
      str = new SimpleDateFormat("yyyy-M-d HH:mm", paramContext.getResources().getConfiguration().locale).format(paramDate);
    }
  }
}